package org.groupg.practice.jdframe;

import org.groupg.practice.model.Student;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class JDFrameDemo {

    public static void main(String[] args) {



        // 待处理数据
        List<Student> studentList = new ArrayList<>();

//// 数据处理
//        List<FI2<String, BigDecimal>> sdf2 = SDFrame.read(studentList) // 转换成DataFrame模型
//                .whereNotNull(Student::getAge)    // 过滤年龄不为null的
//                .whereBetween(Student::getAge, 9, 16)   // 获取年龄在9到16岁之间的
//                .groupBySum(Student::getSchool, Student::getScore) // 按照学校分组求和计算合计分数
//                .whereGe(FI2::getC2, new BigDecimal(1000)) // 过滤合计分数大于等于1000的数据
//                .sortDesc(FI2::getC2) // 按照分组后的合计分数降序排序
//                .cutFirst(10)    // 截取前10名
//                .toLists();     // 转换成List拿到结果

        /*
        select school, sum(score)
        from student
        where age >= 9 and age <= 16 and age is not null
        group by school
        having sum(score) >= 1000
        order by sum(score) desc
        limit 10

         */
    }
}
